home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / share / system-tools-backends-2.0 / scripts / SMBConfig.pm < prev    next >
Encoding:
Perl POD Document  |  2007-03-12  |  1.9 KB  |  69 lines

  1. #-*- Mode: perl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  
  3. # DBus object for the SMB Configuration
  4. #
  5. # Copyright (C) 2005 Carlos Garnacho
  6. #
  7. # Authors: Carlos Garnacho Parro  <carlosg@gnome.org>
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU Library General Public License as published
  11. # by the Free Software Foundation; either version 2 of the License, or
  12. # (at your option) any later version.
  13. #
  14. # This program is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. # GNU Library General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU Library General Public License
  20. # along with this program; if not, write to the Free Software
  21. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  22.  
  23. package SMBConfig;
  24.  
  25. use base qw(StbObject);
  26. use Net::DBus::Exporter ($Utils::Backend::DBUS_PREFIX);
  27. use Shares::SMB;
  28.  
  29. my $OBJECT_NAME = "SMBConfig";
  30. my $OBJECT_PATH = "$Utils::Backend::DBUS_PATH/$OBJECT_NAME";
  31. my $format = [[ "array", [ "struct", "string", "string", "string", "int32", "int32", "int32", "int32" ]],
  32.               "string", "string", "int32", "string" ];
  33.  
  34. sub new
  35. {
  36.   my $class   = shift;
  37.   my $self    = $class->SUPER::new ($OBJECT_PATH, $OBJECT_NAME);
  38.  
  39.   bless $self, $class;
  40.  
  41. #  Utils::Monitor::monitor_files (&Shares::SMB::get_distro_smb_file (),
  42. #                                 $self, $OBJECT_NAME, "changed");
  43.   return $self;
  44. }
  45.  
  46. dbus_method ("get", [], $format);
  47. dbus_method ("set", $format, []);
  48. #dbus_signal ("changed", []);
  49.  
  50. sub get
  51. {
  52.   my ($self) = @_;
  53.   $self->SUPER::reset_counter ();
  54.  
  55.   return &Shares::SMB::get ();
  56. }
  57.  
  58. sub set
  59. {
  60.   my ($self, @config) = @_;
  61.   $self->SUPER::reset_counter ();
  62.  
  63.   &Shares::SMB::set (@config);
  64. }
  65.  
  66. my $config = SMBConfig->new ();
  67.  
  68. 1;
  69.